using System.Security.Principal;
using System.Web;

namespace Zavand.Web.Mvc.Manana.FrameworkUnitTests
{
    class MockHttpContext : HttpContextBase
    {
        private readonly IPrincipal _user = new GenericPrincipal(
            new GenericIdentity("someUser"), null /* roles */);

        private IHttpHandler _currentHandler = null;
        private IHttpHandler _handler = null;
        public override IPrincipal User
        {
            get
            {
                return _user;
            }
            set
            {
                base.User = value;
            }
        }
        public override void RemapHandler(IHttpHandler handler)
        {
            _currentHandler = handler;
            _handler = handler;
        }
        public override IHttpHandler CurrentHandler
        {
            get
            {
                return _currentHandler;
            }
        }
        public override IHttpHandler Handler
        {
            get
            {
                return _handler;
            }
            set
            {
                _handler = value;
            }
        }
    }
}